package entidades;

import java.util.ArrayList;
import java.util.Comparator;

public class Partida implements Comparator<Partida> {
	private Long matchID;
	private Long gameMode;
	private Boolean radiantWin;
	private Long duration;

	private ArrayList<Player> players;

	public Partida(Long matchID) {
		this.matchID = matchID;

		players = new ArrayList<Player>();
	}

	public Partida(Long matchID, Long gameMode, Boolean radiantWin,
			Long duration, ArrayList<Player> players) {
		super();
		this.matchID = matchID;
		this.gameMode = gameMode;
		this.radiantWin = radiantWin;
		this.duration = duration;
		this.players = players;
	}

	public Long getMatchID() {
		return matchID;
	}

	public void setMatchID(Long matchID) {
		this.matchID = matchID;
	}

	public Long getGameMode() {
		return gameMode;
	}

	public void setGameMode(Long gameMode) {
		this.gameMode = gameMode;
	}

	public Boolean getRadiantWin() {
		return radiantWin;
	}

	public void setRadiantWin(Boolean radiantWin) {
		this.radiantWin = radiantWin;
	}

	public Long getDuration() {
		return duration;
	}

	public void setDuration(Long duration) {
		this.duration = duration;
	}

	public ArrayList<Player> getPlayers() {
		return players;
	}

	public void setPlayers(ArrayList<Player> players) {
		this.players = players;
	}

	public String toString() {
		String s = null;

		s = this.getMatchID().toString();

		return s;
	}

	public void addPlayer(Player p) {
		players.add(p);
	}

	public int compare(Partida o1, Partida o2) {
		return o1.getMatchID().compareTo(o2.getMatchID());
	}
	
	public boolean equals(Object o){
		boolean res = false;
		
		if(o instanceof Partida){
			Partida aux = (Partida) o;
			
			if(aux.getMatchID().equals(this.getMatchID())){
				return true;
			}
		}
		
		
		return res;
	}
}





























